<div
    class="node-wrapper"
    [ngStyle]="{ cursor: data.config.isRoot ? 'pointer' : 'inherit' }"
>
    <a
        class="btn-delete"
        *ngIf="data.config.isRoot"
        nz-popconfirm
        nzPopconfirmTitle="该节点的子节点也会一起删除，确定删除吗？"
        (nzOnConfirm)="confirm()"
        nzPopconfirmPlacement="top"
    >
        <img
            src="https://gitee.com/lyq2/blog-images/raw/master/imgs/ico-delete2.png"
        />
    </a>
    <div class="ico-wrapper" (click)="data.config.isRoot ? openDrawwe() : null">
        <img
            *ngIf="data.config.isRoot"
            src="https://gitee.com/lyq2/blog-images/raw/master/imgs/ico-time-root.png"
            alt="ico"
        />
        <img
            *ngIf="!data.config.isRoot"
            src="https://gitee.com/lyq2/blog-images/raw/master/imgs/ico-time-branch.png"
            alt="ico"
        />
    </div>
    <div class="title-wrapper">
        {{ data.config.isRoot ? "时间条件" : data.config.time }}
    </div>
</div>

<nz-drawer
    [nzMaskClosable]="true"
    [nzVisible]="visible"
    nzPlacement="right"
    nzTitle="时间分支"
    [nzWidth]="480"
    (nzOnClose)="closeDrawer()"
    *ngIf="data.config.isRoot"
>
    <div *ngFor="let item of timeArr; index as i" style="margin-bottom: 20px">
        <nz-date-picker
            style="width: 310px; margin-right: 20px"
            nzFormat="yyyy-MM-dd HH:mm:ss"
            [nzDisabledDate]="disabledDate"
            [(ngModel)]="item.config.time"
            [nzShowTime]="{ nzDefaultOpenValue: timeDefaultValue }"
            [nzAllowClear]="false"
        ></nz-date-picker>
        <button nz-button nzType="primary" nzDanger (click)="removeTime(i)">
            删除时间
        </button>
    </div>
    <div>
        <button
            [disabled]="timeArr.length >= maxBranchs"
            style="margin-left: 330px"
            nz-button
            nzType="primary"
            (click)="addTime()"
        >
            增加时间
        </button>
    </div>

    <!-- <ng-template #footerTpl>
        <div style="float: right">
            <button nz-button style="margin-right: 8px" (click)="closeDrawer()">
                取消
            </button>
            <button nz-button nzType="primary" (click)="save()">保存</button>
        </div>
    </ng-template> -->
</nz-drawer>
